<?php
    $pid = Yii::app()->request->getParam('pid');
    $nid = Yii::app()->request->getParam('nid');
?>
<div class="clear"></div>
<script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl; ?>/ckeditor/ckeditor.js"></script>
<script type="text/javascript">
window.onload = function()
{
CKEDITOR.replace( 'notebookContent' );
}
$(document).ready(function(){
    
    $("#addNewCategory").hide();
    $("#selectCategory").change(function(){
        if ($(this).val() == "-"){
            $("#addNewCategory").show();
        }
        else{
            $("#addNewCategory").hide();
        }
    });
});
</script>

<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/notebook.css" />
			<div id="than">	
			           	 <img src="<?php echo Html::imageUrl("muiten.png");?>" width="27" height="26"; style="float:left">
			            	<div id="textxanhdam">Notebooks </div>
			 </div>
             <div class="padding15"></div>                    	
            	<!-- Begin leftSidebar --> 
				
				<!-- Begin rightSidebar -->
                <div id="rightSidebar">
                	<div id="rightHeader">
						<h2><?php echo $notebook->notebook_name; ?></h2>
					</div>
					<div id="rightWrapper">
						<!-- Begin notebookWrapper -->
						<div class="notebookWrapper">
							<form method="post">
								<h3 style="display: inline">Notebook page name</h3>
								<font color="#777777" style="display: inline;">("Latest Press Release" or "Project Guidelines", etc.)</font>
								<br></br>
								<input type="text" id="notebookInputName" name="notebookInputName" value="<?php echo $notebook->notebook_name?>"></input>
								
								<h3>Notebook category</h3>
								<select id="selectCategory" name="selectCategory">
                                                                        <!-- List notebook categories -->
                                                                        <?php
                                                                            foreach ($notebookCategories as $noteCategory){
                                                                                if ($noteCategory->notebook_category_id != $notebook->notebook_category_id)
                                                                                    echo "<option value='{$noteCategory->notebook_category_id}' >{$noteCategory->notebook_category_name}</option>";
                                                                                else
                                                                                    echo "<option value='{$noteCategory->notebook_category_id}' selected='selected' >{$noteCategory->notebook_category_name}</option>";
                                                                            }
                                                                        ?>
                                                                        <!-- End list notebook category -->
									<option value="-">- New category - </option>
								</select>
								<div class="padding10"></div>
								
								<div id="addNewCategory">
										<h3>New Category</h3> 
										<div class="padding5"></div>
										<input type="text" name="new-category-name" size="100px"></input>
										<div class="padding15"></div>
								</div>
									
								
								<h3>Write your content</h3>
								<textarea name="notebookContent" id="notebookContent">
									<p>
										<?php echo $notebook->notebook_content; ?>
									</p>
								</textarea>
								<div class="padding10"></div>
								<div id="postNotebook">
									<input type="submit" value="Save this page"></input> or
									<a href="<?php echo Yii::app()->controller->createUrl("/notebooks/detail/",array("pid"=>$pid,"nid"=>$nid));?>" class="notebookCancel">Cancel</a>
								</div>
							</form>
						<!-- End notebookWrapper -->	
						</div>
					</div>
				</div>
				<!-- End rightSidebar -->
				
    </div>